﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Castle.MicroKernel;
using Castle.Windsor;
using MyCastleWindsor.Castle;
using MyCastleWindsor.Models;

namespace MyCastleWindsor.Controllers
{
    public class HomeController : Controller
    {
        private ITest _test;

        public ActionResult Index()
        {
            WindsorContainer container = WindsorInit.GetContainer();
            //_test = container.Resolve<ITest>(new Arguments(new { }));
            _test = container.Resolve<ITest>(new Arguments());
            var result = _test.Add(10, 20);
            ViewBag.result = result;

            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}